﻿using Omabar.BLL;
using Omabar.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Omabar.CMS.CMS
{
    public partial class PackageAdd : System.Web.UI.Page
    {
        protected string id;
        protected PACKAGE package;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                id = Request["id"];
                if (string.IsNullOrEmpty(id))
                    Response.Redirect("RouteList.aspx");

                Package_BLL bll = new Package_BLL();
                package = bll.GetModelBySQL(string.Format("SELECT PACKAGE_ID,PACKAGE_DES,PACKAGE_INCLUDE,PACKAGE_EXCLUDE FROM PACKAGE WHERE PACKAGE_ID IN (SELECT PACKAGE_ID FROM ROUTE_PACKAGE WHERE ROUTE_ID='{0}')", id));
                if (package == null) package = new PACKAGE();
            }
        }
    }
}